package judesart.app.client.project;

import com.google.gwt.user.client.rpc.impl.RemoteServiceProxy;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.ResponseReader;
import com.google.gwt.core.client.impl.Impl;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter;

public class ProjectController_Proxy extends RemoteServiceProxy implements judesart.app.client.project.ProjectControllerAsync {
  private static final String REMOTE_SERVICE_INTERFACE_NAME = "judesart.app.client.project.ProjectController";
  private static final String SERIALIZATION_POLICY ="E0E2638D1318177F729989ADFA1A9337";
  private static final judesart.app.client.project.ProjectController_TypeSerializer SERIALIZER = new judesart.app.client.project.ProjectController_TypeSerializer();
  
  public ProjectController_Proxy() {
    super(GWT.getModuleBaseURL(),
      "project", 
      SERIALIZATION_POLICY, 
      SERIALIZER);
  }
  
  public void createProject(judesart.app.domain.Project project, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.createProject", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("createProject");
      streamWriter.writeInt(1);
      streamWriter.writeString("judesart.app.domain.Project/2287990793");
      streamWriter.writeObject(project);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.createProject", requestId, "requestSerialized"));
      doInvoke(ResponseReader.OBJECT, "ProjectController_Proxy.createProject", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void deleteProject(java.lang.Long projectId, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.deleteProject", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("deleteProject");
      streamWriter.writeInt(1);
      streamWriter.writeString("java.lang.Long/4227064769");
      streamWriter.writeObject(projectId);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.deleteProject", requestId, "requestSerialized"));
      doInvoke(ResponseReader.VOID, "ProjectController_Proxy.deleteProject", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void deleteSketchFromProject(java.lang.Long projectId, java.lang.Long imageId, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.deleteSketchFromProject", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("deleteSketchFromProject");
      streamWriter.writeInt(2);
      streamWriter.writeString("java.lang.Long/4227064769");
      streamWriter.writeString("java.lang.Long/4227064769");
      streamWriter.writeObject(projectId);
      streamWriter.writeObject(imageId);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.deleteSketchFromProject", requestId, "requestSerialized"));
      doInvoke(ResponseReader.VOID, "ProjectController_Proxy.deleteSketchFromProject", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void getProject(java.lang.Long id, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.getProject", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("getProject");
      streamWriter.writeInt(1);
      streamWriter.writeString("java.lang.Long/4227064769");
      streamWriter.writeObject(id);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.getProject", requestId, "requestSerialized"));
      doInvoke(ResponseReader.OBJECT, "ProjectController_Proxy.getProject", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void searchProjects(int startAt, int maxElements, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.searchProjects", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("searchProjects");
      streamWriter.writeInt(2);
      streamWriter.writeString("I");
      streamWriter.writeString("I");
      streamWriter.writeInt(startAt);
      streamWriter.writeInt(maxElements);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.searchProjects", requestId, "requestSerialized"));
      doInvoke(ResponseReader.OBJECT, "ProjectController_Proxy.searchProjects", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void updateProject(judesart.app.domain.Project project, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.updateProject", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("updateProject");
      streamWriter.writeInt(1);
      streamWriter.writeString("judesart.app.domain.Project/2287990793");
      streamWriter.writeObject(project);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.updateProject", requestId, "requestSerialized"));
      doInvoke(ResponseReader.OBJECT, "ProjectController_Proxy.updateProject", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
  
  public void updateSketchDescription(java.lang.String sketchKey, java.lang.String description, com.google.gwt.user.client.rpc.AsyncCallback callback) {
    int requestId = getNextRequestId();
    boolean toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.updateSketchDescription", requestId, "begin"));
    SerializationStreamWriter streamWriter = createStreamWriter();
    // createStreamWriter() prepared the stream
    try {
      streamWriter.writeString(REMOTE_SERVICE_INTERFACE_NAME);
      streamWriter.writeString("updateSketchDescription");
      streamWriter.writeInt(2);
      streamWriter.writeString("java.lang.String/2004016611");
      streamWriter.writeString("java.lang.String/2004016611");
      streamWriter.writeString(sketchKey);
      streamWriter.writeString(description);
      String payload = streamWriter.toString();
      toss = isStatsAvailable() && stats(timeStat("ProjectController_Proxy.updateSketchDescription", requestId, "requestSerialized"));
      doInvoke(ResponseReader.STRING, "ProjectController_Proxy.updateSketchDescription", requestId, payload, callback);
    } catch (SerializationException ex) {
      callback.onFailure(ex);
    }
  }
}
